{__NOLAYOUT__}
<script type="text/javascript">
    window.UEDITOR_HOME_URL = "__PUBLIC__/Lib/ueditor/";
</script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Lib/ueditor/editor_all.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Lib/ueditor/editor_config.js"></script>
<div class="table" style="width: 100%;height: 500px;margin: 0px auto;overflow: auto;overflow: auto;" id="add">
    <form action="#" method="post" id="formvalidate" class="formvalidate" name="formvalidate">
        <fieldset>
            <legend>参数设置</legend>
            <table class="list" cellpadding="0" cellspacing="1" border="0">
                <tbody>
                    <tr>
                        <td class="name" width="250">
                            <label class="validation">支付方式&nbsp:</label>
                        </td>
                        <td>
                            {$Think.lang.$list[pay_code]}
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            <label class="validation"><span class="spanMsg">*</span>支付方式名称&nbsp:</label>
                        </td>
                        <td>
                            <input type="hidden"  name="name" value="{$Think.lang.$list[pay_code]}" />
                            <input type="hidden"  name="pay_code" value="{$list.pay_code}" />
                            <input type="hidden"  name="pay_id" value="{$list.pay_id}" />
                            <input type="hidden"  name="pay_is_online" value="{$list.pay_is_online}" />
                            <input name="pay_name" type="text" class="input rounded" value="{$list.pay_name}" size="30" maxlength="50" required validate="{ required:true,maxlength:30,messages:{required:'支付方式不能为空'}}" /> 
                        </td>
                    </tr>
                    <foreach name="list.config" item="conf" key="ky">
                        <tr>
                            <td class="name">
                                <label class="validation">{$conf.name}&nbsp:</label>
                            </td>
                            <td>
                                <input name="config_name[]" type="hidden"  value="{$ky}"/> 
                                    <if condition="$conf.type eq 'text'">
                                        <input name="config_value[]" type="text" class="input rounded" value="{$conf.value}" size="30" maxlength="50" /> 
                                    <elseif condition="$conf.type eq 'select'" />
                                        <select name="config_value[]" value="0">
                                            <foreach name="conf.range" item="val" key="k">
                                                <option value="{$k}" <if condition="$conf.val eq $k">selected="selected"</if>>{$val}</option>
                                            </foreach>
                                        </select>
                                        <!--<input name="u_name" type="text" class="input rounded" value="" size="30" maxlength="50" />--> 
                                    </if>
                            </td>
                        </tr>
                    </foreach>
                    
                    <tr>
                        <td class="name">
                            <label class="validation">
                                支付方式描述&nbsp:
                            </label>
                        </td> 
                        <td>
                            <textarea class="text-input textarea" id="wysiwyg" name="pay_desc" rows="10" cols="56">{$list.pay_desc}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            <label class="validation">排序&nbsp:</label>
                        </td>
                        <td>
                            <input type="text" name="pay_order" value="10" class="input rounded" size="10">  
                        </td>
                    </tr>
                    <tr>
                        <td class="name">
                            <label class="validation">在线支付&nbsp:</label>
                        </td>
                        <td>
                            <if condition="$list.pay_is_online eq '1'">是<else />否</if>
                        </td>
                    </tr>
                    <tr>
                        <td class="name" width="150">
                            <label class="validation">
                                <span class="spanMsg">*</span>支付手续费&nbsp:
                            </label>
                        </td>  
                        <td class="rowform">
                            <ul id="payiscode">

                                <li>
                                    <label>
                                        <input type="radio" <if condition="$list.pay_is_cod eq '0'">checked="checked"</if> value="0" name="pay_is_cod">按比例收费
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input type="radio" value="1" <if condition="$list.pay_is_cod eq '1'">checked="checked"</if> name="pay_is_cod">固定费用</label>
                                </li>
                            </ul>
                        </td>
                    </tr>
                    <tr id="rate">
                        <td class="name">
                        </td>
                        <td>
                            费率&nbsp<input type="text" name="pay_rate" value="{$list.pay_fee}" class="input rounded" size="10">%&nbsp;&nbsp;说明：顾客将支付订单总金额乘以此费率作为手续费；
                        </td>
                    </tr>
                    <tr id="fix" style="display: none;">
                        <td class="name">
                        </td>
                        <td>
                            金额&nbsp<input type="text" name="pay_fix" value="{$list.pay_fee}" class="input rounded" size="10">&nbsp;&nbsp;说明：顾客每笔订单需要支付的手续费；
                        </td>
                    </tr>
                </tbody>
            </table>
        </fieldset>
    </form>
</div>
<script>
    $(document).ready(function(){
        $("#payiscode input[type='radio']").click(function(){
            var val = $(this).val();
            if(val == '1'){
                $("#fix").show();
                $("#rate").hide();
            }else{
                $("#rate").show();
                $("#fix").hide();
            }
        });
        
        
    })
</script>